fix(api): sanitize error responses in HTTP handlers#67
Closed
skhaz wants to merge 1 commit into
Closed
Conversation
Why: HTTP handlers wrote raw upstream error strings into client responses, disclosing driver, schema and internal error details to external clients -- the same information-disclosure class as the userspace login credential leak. What: Route HTTP handler error responses through a per-namespace api_error helper that logs the raw error server-side via logger and returns only a static public message. Status codes and other response fields are preserved; text (non-JSON) handlers log the error and write a static message.
Member
Author
|
Superseded by a runtime-level egress secret-redaction filter in wippyai/runtime: a single central control that masks known secrets in all HTTP responses (and alerts on it) without per-project changes. Closing this per-project boundary sanitization in favor of that approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
HTTP handlers wrote raw upstream error strings into client responses, disclosing driver/schema/internal error details to external clients — the same information-disclosure class as the userspace login credential leak.
What
A per-namespace
api_errorhelper logs the raw error server-side vialoggerand returns only{ success = false, error = <public message> }. Every HTTP handler routes its error responses through it. HTTP status codes and other response fields are preserved; text (non-JSON) handlers log the error and write a static message.Testing
http.endpoint→ handler source): zero raw error variables reach any client response field after the change. Remaining grep hits are all server-sidelog:tables, sanitizing helpers, or guarded client-safe domain messages.luac -pclean on all edited non-type-annotated files.